package com.huawei.spare.part.replace.rx;

import io.reactivex.Completable;

public class Defer {

    public static void main(String[] args) {
        Completable.create(emitter -> {
            System.out.println("on run");
            emitter.onComplete();
        }).doOnSubscribe((e) -> {
            System.out.println("on subscript");
        }).doOnSubscribe((e) -> {
            System.out.println("on subscript 2");
        }).doFinally(()-> {
            System.out.println("final");
        }).doOnComplete(() -> {
            System.out.println("complete");
        }).subscribe();
    }
}
